<#compress>
    <#assign actionname>${(action=='create')?string('新建','编辑')}</#assign>
    <@override name="title">${actionname}楼层</@override>
    <@override name="viewbody">
    <div class="row">
        <div class="col-md-12">
            <h3 class="page-title">
            ${actionname}楼层
                <small>${actionname}楼层.</small>
            </h3>
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="${ctx}/admin/home">
                        首页
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="${ctx}/admin/floor">
                        楼层管理
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">
                    ${actionname}楼层
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading"><h6 class="panel-title">楼层信息</h6></div>
        <div class="panel-body">
            <form class="form-horizontal" action="${ctx}/admin/floor/save" role="form" id="floorForm" method="post">
                <input name="floor.id" type="hidden" value="${floor.id!}"/>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="floorName">楼层名称: <span class="required">*</span></label>

                    <div class="col-sm-10">
                        <input type="text" class="required form-control input-xlarge" placeholder="楼层名称"
                               name="floor.name" id="floorName" value="${floor.name!}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="nick_name">楼层别名:</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control input-xlarge" placeholder="楼层名称"
                               name="floor.nick_name" id="nick_name" value="${floor.nick_name!}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="description">楼层描述:</label>

                    <div class="col-sm-10">
                        <textarea rows="5" cols="5" id="description" class="limited form-control input-xlarge"
                                  name="floor.description"
                                  placeholder="请输入楼层描述">${floor.description!}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="parking">停车场:</label>

                    <div class="col-sm-10">
                        <div class="checkbox-list">
                            <label> <input type="checkbox" name="parking" <#if floor.parking?? && floor.parking>checked="checked" </#if> > 停车场</label>
                        </div>

                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="floor_mall">所属购物中心: </label>

                    <div class="col-sm-10">
                        <select data-placeholder="选择购物中心" name="floor.mall" id="floor_mall"
                                class="required form-control input-xlarge select2me">
                            <#if mallblock??>
                                <#list mallblock as mb>
                                    <option value="${mb.id}"
                                            <#if floor.mall?? && floor.mall == mb.id>selected="selected"</#if> >${mb.name}
                                        --${mb.blockname}</option>
                                </#list>
                            </#if>
                        </select>
                        <span class="help-block" id="malldesc">购物中心--所属集团.</span>
                    </div>
                </div>

                <#--<div class="form-group">

                    <label class="col-sm-2 control-label" for="pricture"></label>

                    <div class="col-lg-2 col-md-4 col-sm-4">
                        <p class="form-control-static">
                            <input id="floorAttachmentUpload" type="file" class="btn">
                        </p>
                    </div>
                    <input type="hidden" id="picture" name="floor.picture" value="${floor.picture!}">
                </div>

                <div class="form-group" id="show_picture"
                     style="display: ${(floor.picture??)?string('display','none')};">
                    <label class="col-sm-2 control-label text-right">楼层图片:</label>

                    <div class="col-lg-2 col-md-4 col-sm-4">
                        <p class="form-control-static">
                            <a href="<#if floor.picture??>${ctx}/${floor.picture}</#if>"
                               class="thumbnail fancybox-button" id="box_picture" data-rel="fancybox-button">
                                <img src="<#if floor.picture??>${ctx}/${floor.picture?replace('.','.thumbnail.')}</#if>"
                                     alt=""/>
                            </a></p>
                    </div>
                </div>-->
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="picture">楼层图片: <span class="required">*</span></label>

                    <div class="col-sm-10">
                        <div class="fileinput fileinput-exists">
                            <input type="hidden" value="${floor.picture!}" id="picture" name="floor.picture">

                            <div class="fileinput-btn">
                                <span class="btn default btn-file">
                                    <span class="fileinput-new" id="pic_image_btn">&nbsp;</span>
                                </span>
                                <#if floor.picture??><a href="#" data-data="${floor.picture}"
                                                     class="btn default fileinput-exists fileinput-remove">删除图片</a></#if>
                            </div>
                            <div class="fileinput-preview thumbnail"
                                 style="width: 200px; height: 150px; line-height: 150px;">
                                <#if floor.picture??><a href="${ctx}${floor.picture}" class="thumbnail fancybox-button">
                                    <img class="" src="${ctx}${floor.picture?replace('.','.thumbnail.')}" alt="">
                                </a></#if>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="location_image">位置图片: <span class="required">*</span></label>

                    <div class="col-sm-10">
                        <div class="fileinput fileinput-exists">
                            <input type="hidden" value="${floor.location_image!}" id="location_image" name="floor.location_image">

                            <div class="fileinput-btn">
                                <span class="btn default btn-file">
                                    <span class="fileinput-new" id="location_image_btn">&nbsp;</span>
                                </span>
                                <#if floor.location_image??><a href="#" data-data="${floor.location_image}"
                                                     class="btn default fileinput-exists fileinput-remove">删除图片</a></#if>
                            </div>
                            <div class="fileinput-preview thumbnail"
                                 style="width: 200px; height: 150px; line-height: 150px;">
                                <#if floor.location_image??><a href="${ctx}${floor.location_image}" class="thumbnail fancybox-button">
                                    <img class="" src="${ctx}${floor.location_image?replace('.','.thumbnail.')}" alt="">
                                </a></#if>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-actions text-right">

                    <a class="btn default yellow-stripe" href="${ctx}/admin/floor"><i
                            class="fa fa-arrow-circle-o-left"></i> 返回</a>
                    <input type="submit" value="保存" class="btn btn-primary">
                </div>

            </form>
        </div>

    </div>
    </@override>

    <@override name="viewmodule">floor_item</@override>
    <@extends name="../_basic/main.ftl"></@extends>
</#compress>